package org.knot.mockejb3;

import java.io.Serializable;


public abstract class BasicEjbDescriptor implements Serializable {
    
    private Class ifaceClass;
    private Class beanClass;
    private Object bean;
    private String jndiName;
    
    /**
     * Creates a new instance of the descriptor.
     * @param jndiName  jndiName to bind Home to. Note that MockEjb does not support
     * bean-scoped context, so this name must be unique.
     * @param homeClass class of the home interface 
     * @param ifaceClass class of the business interface, remote or local
     * @param beanClass class of the implementation class 
     */     
    // TODO: Deprecate?
    public BasicEjbDescriptor( String jndiName, Class ifaceClass, 
        Class beanClass ) {
        
        this.jndiName = jndiName;
        this.ifaceClass = ifaceClass;    
        this.beanClass = beanClass;
    }

    /**
     * Creates a new instance of the descriptor.
     * @param jndiName  jndiName to bind Home to. Note that MockEjb does not support
     * bean-scoped context, so this name must be unique.
     * @param homeClass class of the home interface 
     * @param ifaceClass class of the business interface, remote or local
     * @param bean instance of a bean implementation class. 
     */     
    public BasicEjbDescriptor( String jndiName,  Class ifaceClass, 
            Object bean ) {
        
        this.jndiName = jndiName;
        this.ifaceClass = ifaceClass;    
        this.bean = bean;
    }
    
    
    public String getJndiName(){
        return jndiName;
    }
    
    
    public Class getBeanClass(){
        return beanClass;
    }

    public Object getBean(){
        return bean;
    }
    
    
    public Class getIfaceClass(){
        return ifaceClass;
    }
    
}
